<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
	<head>
		<meta charset="UTF-8">
		<title>主页面</title>
		<link rel="stylesheet" href="./webjars/bootstrap/3.3.7/css/bootstrap.css">
		<link rel="stylesheet" href="./webjars/bootstrap/3.3.7/css/bootstrap-theme.css">
		<link rel="stylesheet" href="./webjars/bootstrapvalidator/0.5.3/css/bootstrapValidator.css">
		<link rel="stylesheet" href="./static/bootstraptable/bootstrap-table.css">
		<script type="text/javascript" src="./webjars/jquery/1.11.1/jquery.js"></script>
		<script type="text/javascript" src="./webjars/bootstrap/3.3.7/js/bootstrap.js"></script>
		<script type="text/javascript" src="./static/bootstraptable/bootstrap-table.js"></script>
		<script type="text/javascript" src="./static/bootstraptable/locale/bootstrap-table-zh-CN.js"></script>
		<script type="text/javascript" src="./webjars/bootbox/5.4.0/bootbox.all.js"></script>
		<script type="text/javascript" src="./static/bootstraptable/extensions/treegrid/bootstrap-table-treegrid.js"></script>
		<script type="text/javascript" src="./webjars/bootstrapvalidator/0.5.3/js/bootstrapValidator.js"></script>
		<script type="text/javascript" src="./webjars/bootstrapvalidator/0.5.3/js/language/zh_CN.js"></script>
		<script type="text/javascript" src="./static/custom/custom.js"></script>
	</head>
	<body>
		<nav class="navbar navbar-inverse navbar-fixed-top" style="border: none;">
			<div class="container-fluid container">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
					 aria-expanded="false">
						<span class="sr-only"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<a class="navbar-brand active"  href="#">Bootstrap成绩管理</a>
				</div>
				<div class="collapse navbar-collapse" id="d3">
					<ul class="nav navbar-nav">
						<li><a href="#" class="glyphicon glyphicon-home" onclick="zy()"></a></li>
						<li><a href="#"onclick="kc()">课程管理</a></li>
						<li><a href="#"onclick="xs()">学生管理</a></li>
						<li><a href="#"onclick="bj()">班级管理</a></li>
						 <li><a href="#"onclick="bm()">部门管理</a></li> 
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">成绩管理<span class="caret"></span></a>
						<ul class="dropdown-menu">
							<li><a href="#"onclick="grcjlr()">个人成绩录入</a></li>
							<li role="separator" class="divider"></li>  <!--分割线  -->
							<li><a href="#"onclick="bjcjlr()">班级成绩录入</a></li>
							<li role="separator" class="divider"></li>  <!--分割线  -->
							<li><a href="#"onclick="bjcjcx()">班级成绩查询</a></li>
						</ul>
						</li>
					</ul>
					
					<ul class="nav navbar-nav navbar-right">
						<li><a href="#">欢迎你：<span sec:authentication="principal.name" style="margin-right: 20px;"></span></a></li>
						<li class="dropdown">
							<a href="#" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-cog"></span>个人管理<span class="caret"></span></a>
						   <ul class="dropdown-menu">
							<li><a href="#"  onclick="xgmm()"><span class="glyphicon glyphicon-pencil"></span>修改密码</a></li>
							<li><a href="#"></a></li>
							<li><a href="logout" ><span class="glyphicon glyphicon-off"></span>注销  </a></li>
						</ul>
						</li>
					</ul>
				</div>
			</div>
		</nav>
<!--下面是中间部分内容 -->
		<div id="nr" style="margin-top: 50px;">
		<blockquote class="blockquote-reverse">
		 <h2> <p>做人如果没有梦想，跟条咸鱼有什么区别。</p>
		  <footer><cite title="Source Title">咸鱼</cite></footer>
		  </h2>
		</blockquote>
		</div>
		<!-- 上面是中间内容 -->
		
		<footer>
		<div id="footer" class="container-fluid text-center" style="min-height: 200px;" >
			<p class="text-muted">
				Copyright<a href="#">© 一条先咸显现鱼 </a>
			</p>
		</div>
	</footer>
		<!-- 下面是页脚 -->
<nav class="navbar navbar-inverse navbar-fixed-bottom">
  <div class="container">
  
  </div>
</nav>
<!-- 页脚 -->
	</body>
	<script type="text/javascript">
		$(function(){
		});
		//课程管理
		function kc() {
			var o=document.getElementById('nr');
			o.innerHTML='';
			$('#nr').load('course/manage');
		}
		//教师管理
		function bj(){
			var o=document.getElementById('nr');
			o.innerHTML='';
			$('#nr').load('banji/manage');
			}
		//学生管理
		function  xs(){
			var o=document.getElementById('nr');
			o.innerHTML='';
			$('#nr').load('student/manage');
			}
			//修改密码
			function xgmm(){
				$(function(){
                         var self=$(this);
						 var dialog=$.createDialog({
							 title:'修改密码',
							 url:'password/edit',
							 buttons:[$.createBtn({
							 	iconCls:'glyphicon glyphicon-floppy-disk',
							 	text:'保存',
							 	btnCls:'btn btn-primary',
							 	handler:function(){
							 		var form=dialog.find('form');
							 		var validator=form.data('bootstrapValidator');
							 		validator.validate();
							 		if(validator.isValid()){
							 			self.attr('disabled',true);
							 		  var fd=form[0];
									  //console.log(fd);
									  var p1=fd.pwd.value;
									  var p2=fd.pwd2.value;
									  var p3=fd.pwd3.value;
									  var params=form.serialize();//序列化表单，，对号入座。
									  if(p1.length==0){
										  bootbox.alert('原密码不能为空哦！');
										  return ;
									  }
									  if(p2.length==0){
										  bootbox.alert('新密码不能为空哦！');
										  return ;
									  }
									  if(p2!=p3){
										  bootbox.alert('两次输入的密码要相同哦！');
										  return ;
									  }else{
							 			$.post('password/save',params,function(data){
							 				if(data.success){
							 					dialog.modal("hide");
							 				bootbox.alert(data.msg);
							 				window.setTimeout("window.location=window.location.pathname+'?logout'",800);
							 					
							 				}else{
												bootbox.alert(data.msg);
												return;
											}
							 					

							 			})	
							 			 }
							 		}
							 	}
							 }),$.createBtn({
							 	iconCls:'glyphicon glyphicon-remove',
							 	text:'关闭',
							 	isCloseBtn:true
							 })]
						 })
						 dialog.modal('show');
				})
				}
				//班级成绩查询
				function bjcjcx(){
					var o=document.getElementById('nr');
					o.innerHTML='';
					$('#nr').load('grade/cjcx');
				}
				//个人成绩录入
				function grcjlr(){
					var o=document.getElementById('nr');
					o.innerHTML='';
					$('#nr').load('grade/grcjlr');
					}
				//班级成绩录入
			   function bjcjlr(){
						var o=document.getElementById('nr');
						o.innerHTML='';
						$('#nr').load('grade/bjcjlr');
						}
				//部门管理
				function bm(){
                       $('#nr').empty();
                       $('#nr').load('menu/manage');
					}
	</script>
</html>
